package org.abettor.pushbox.upload;

import java.util.HashMap;
import java.util.Map;

import org.abettor.pushbox.config.Config;
import org.abettor.pushbox.model.SelfMessage;
import org.abettor.pushbox.net.NetTools;

import android.app.Activity;

public class SendComments {
	private Activity context;
	private NetTools netTools = new NetTools();
	public SendComments(Activity activity) {
		context = activity;
	}
	/**
	 * 发送评论的操作
	 * @param mapId
	 * @param content
	 * @return
	 */
	public boolean sendComments(int mapId,String content){
		Map<String, String> map = new HashMap<String, String>();
		map.put("mapId", String.valueOf(mapId));
		map.put("comment", content);
		SelfMessage self = Config.readSelfMessage(context);
		map.put("nickName", self.getNickName());
		String ret = netTools.postData(Config.addCommentUrl, map);
		if(ParaUploadRetValue.isSendCommentsSuccess(ret)){
			return true;
		}
		return false;
	}
}
